﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;

namespace UpdaterService.WinUI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application. Checks if the application has already been started once.
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool owned;
            // Identify how to 
            Mutex mytex = new Mutex(true, "TheNameOfThisapplication",out owned);

            if (owned)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new WinForm());
            }
            else
            { 
                MessageBox.Show("A previous instance is already running");
                
            }
        }
    }
}
